package com.landmesure.communication;

import android.os.Message;
import android.util.Log;

import static android.content.ContentValues.TAG;
import static com.landmesure.communication.CommunicationPlatform.deadlineTime;
import static com.landmesure.communication.CommunicationPlatform.monitorType;
import static com.landmesure.communication.CommunicationPlatform.sending;

/**
 * 监听任务超时
 */
    public class TaskOvertimeMonitor extends Thread {
        @Override
        public void run() {
            while (true) {
                if (sending){
                    long systemTime = System.currentTimeMillis();
                    if (deadlineTime < systemTime) {
                        Message msg = new Message();
                        msg.what = monitorType;
                        CommunicationPlatform.handler.sendMessage(msg);
                        Log.i(TAG, "yuan超时啦---" + monitorType);
                        sending=false;
                    }
                }
            }

        }
    }

